#ifndef _DISP_MANAGER_H
#define _DISP_MANAGER_H

#include<string.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/fb.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>


typedef struct DispBuffer{
	int iXres;
	int iYres;
	int iBpp;
	char* buffer;
}DispBuffer,*PDispBuffer;


typedef struct Region {
	int iLeftUpX;
	int iLeftUpY;
	int iWidth;
	int iHeight;
}Region, *PRegion;

typedef struct DispOpr{
	char *name;
   	int (*DeviceInit)(void);
	int (*DeviceExit)(void);
	int (*GetBuffer)(PDispBuffer ptDispBuffer);
	int (*FlushRegion)(PRegion ptRegion, PDispBuffer ptDispBuff);
	struct DispOpr *ptNext;
}DispOpr,*PDispOpr;

void RegisterDisplay(PDispOpr ptDispOpr);
void DisplaySystemRegister(void);
int PutPixel(int x, int y, unsigned int color);

int SelectDefaultDisplay(char* name);
int InitDefaultDisplay(void);
PDispBuffer GetDisplayBuffer(void);
int FlushDisplayRegion(PRegion ptRegion, PDispBuffer ptDispBuffer);



#endif
